//
//  UIButton+imageTitleLayout.h
//
//
//  Created by 韩保玉 on 15/6/28.
//  Copyright (c) 2015年 韩保玉. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, ButtonEdgeInsetsStyle) {
    ButtonEdgeInsetsStyleImageLeft,
    ButtonEdgeInsetsStyleImageRight,  //图片在右边
    ButtonEdgeInsetsStyleImageTop,
    ButtonEdgeInsetsStyleImageBottom
};
typedef void(^ButtonBlock)(UIButton* button);

#pragma mark  IBInspectable
@interface UIButton (IB)

/// 按钮标题颜色
@property (nonatomic, strong)IBInspectable NSString *mj_titleColorName;

/// 字体风格
@property (nonatomic, strong)IBInspectable NSString *mj_fontStyleName;

/// 加粗
@property (nonatomic, assign)IBInspectable CGFloat mj_boldSize;

/// 正常字体
@property (nonatomic, assign)IBInspectable CGFloat mj_systemSize;

/// 是否可点击
@property (nonatomic, assign) BOOL mj_enabled;
@end

@interface UIButton (MJUI)

/// 图片和标题
/// @param style 图片在上下左右
/// @param space 间距
- (void)mj_layoutButtonWithEdgeInsetsStyle:(ButtonEdgeInsetsStyle)style imageTitlespace:(CGFloat)space;

/// 添加点击事件
/// @param block 回调
- (void)mj_addAction:(ButtonBlock)block;
- (void)mj_addAction:(ButtonBlock)block forControlEvents:(UIControlEvents)controlEvents;

/**
 @method 指定的字符串修改字体大小，颜色
 
 @param arrString 字符串数组
 @param font      字体
 @param color     修改的颜色

 */
- (void)mj_paragraphStyleWithArrString:(NSArray *)arrString title:(NSString *)title font:(UIFont *)font color:(UIColor *)color;

@end

@interface UIButton (Language)

/// 语言
@property (nonatomic, strong)IBInspectable NSString *mj_localizable;

@end

@interface UIButton (Countdown)

/// 倒计时
/// @param duration 60
-(void)mj_createTimerWithDuration:(NSInteger)duration;

@end
